

#ifndef COMPANYAO_INTERFACE_H
#define COMPANYAO_INTERFACE_H

#include <stdint.h>
#include <string>
#include "app_platform/cntl_info.h"

#include <set>	
#include <map>	
#include <vector>	
#include "erp/company/po/companyfilterpo_company.h"	
#include "erp/company/po/companyinfopo_company.h"	


namespace erp
{
namespace company
{
namespace ao
{

	/// 同步调用接口
	class ICompanyAo	{
	public:
		virtual ~ICompanyAo() {}

	public:

		/**
		 *
	 	 * 添加/修改用户企业信息；传入用户企业SysNo不为0时则进行修改，反之则进行添加；
		 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景ID，必填  				
		 *@param uint32_t option: 功能选项，扩展选填  				
		 *@param CompanyInfoPo companyInfoPo: 用户企业PO，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param String outReserve: 返回保留字   		
		 *
		 *@return  uint32_t : 0(成功) 其它失败
 	     *
		 */
	    virtual uint32_t AddAndUpdateCompanyInfo(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				uint32_t option,
				const erp::company::po::CCompanyInfoPo& companyInfoPo,
				const std::string& inReserve,
				std::string& errmsg,
				std::string& outReserve
	    	) = 0;

		/**
		 *
	 	 * 删除用户企业（逻辑）
		 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景ID，必填  				
		 *@param uint32_t option: 功能选项，扩展选填  				
		 *@param uint64_t companySysNo: 需删除用户企业的SysNo，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param String outReserve: 返回保留字   		
		 *
		 *@return  uint32_t : 0(成功) 其它失败
 	     *
		 */
	    virtual uint32_t DeleteCompanyInfo(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				uint32_t option,
				uint64_t companySysNo,
				const std::string& inReserve,
				std::string& errmsg,
				std::string& outReserve
	    	) = 0;

		/**
		 *
	 	 * 根据过滤条件查询用户企业列表信息
		 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景ID，必填  				
		 *@param uint32_t option: 功能选项，扩展选填  				
		 *@param CompanyFilterPo filter: 过滤器，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param uint32_t total: 用户企业总数 		
		 *@param Vector companyInfoPo: 用户企业列表信息 		
		 *@param String outReserve: 返回保留字   		
		 *
		 *@return  uint32_t : 0(成功) 其它失败
 	     *
		 */
	    virtual uint32_t GetCompanyInfoByFilter(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				uint32_t option,
				const erp::company::po::CCompanyFilterPo& filter,
				const std::string& inReserve,
				std::string& errmsg,
				uint32_t& total,
				std::vector<erp::company::po::CCompanyInfoPo >& companyInfoPo,
				std::string& outReserve
	    	) = 0;

		/**
		 *
	 	 * 根据用户企业ID批量获取用户企业信息
		 *
		 *@param String machineKey: 机器码，必填  				
		 *@param String source: 调用来源，必填  				
		 *@param uint32_t sceneId: 场景ID，必填  				
		 *@param uint32_t option: 功能选项，扩展选填  				
		 *@param Set companySysNo: 需获取的用户企业SysNo，必填  				
		 *@param String inReserve: 请求保留字  				
		 *@param String errmsg: 错误信息  		
		 *@param Map errorCode: 获取失败的错误码 		
		 *@param Map errorMsg: 获取失败的错误信息 		
		 *@param Map companyInfoPo: 获取成功的用户企业信息 		
		 *@param String outReserve: 返回保留字   		
		 *
		 *@return  uint32_t : 0(成功) 其它失败
 	     *
		 */
	    virtual uint32_t GetCompanyInfoByIds(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				uint32_t option,
				const std::set<uint64_t >& companySysNo,
				const std::string& inReserve,
				std::string& errmsg,
				std::map<uint64_t,uint32_t >& errorCode,
				std::map<uint64_t,std::string >& errorMsg,
				std::map<uint64_t,erp::company::po::CCompanyInfoPo >& companyInfoPo,
				std::string& outReserve
	    	) = 0;
	};

	///异步调用接口
	class ICompanyAoAsyc
	{
	public:
		virtual ~ICompanyAoAsyc() {}
	public:
		virtual uint32_t SendAddAndUpdateCompanyInfo(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				uint32_t option,
				const erp::company::po::CCompanyInfoPo& companyInfoPo,
				const std::string& inReserve
				) = 0;
		virtual uint32_t RecvAddAndUpdateCompanyInfo(
				const CCntlInfo& rCntlInfo,

				std::string& errmsg,
				std::string& outReserve
				) = 0;
		virtual uint32_t SendDeleteCompanyInfo(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				uint32_t option,
				uint64_t companySysNo,
				const std::string& inReserve
				) = 0;
		virtual uint32_t RecvDeleteCompanyInfo(
				const CCntlInfo& rCntlInfo,

				std::string& errmsg,
				std::string& outReserve
				) = 0;
		virtual uint32_t SendGetCompanyInfoByFilter(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				uint32_t option,
				const erp::company::po::CCompanyFilterPo& filter,
				const std::string& inReserve
				) = 0;
		virtual uint32_t RecvGetCompanyInfoByFilter(
				const CCntlInfo& rCntlInfo,

				std::string& errmsg,
				uint32_t& total,
				std::vector<erp::company::po::CCompanyInfoPo >& companyInfoPo,
				std::string& outReserve
				) = 0;
		virtual uint32_t SendGetCompanyInfoByIds(
				const CCntlInfo& rCntlInfo,

				const std::string& machineKey,
				const std::string& source,
				uint32_t sceneId,
				uint32_t option,
				const std::set<uint64_t >& companySysNo,
				const std::string& inReserve
				) = 0;
		virtual uint32_t RecvGetCompanyInfoByIds(
				const CCntlInfo& rCntlInfo,

				std::string& errmsg,
				std::map<uint64_t,uint32_t >& errorCode,
				std::map<uint64_t,std::string >& errorMsg,
				std::map<uint64_t,erp::company::po::CCompanyInfoPo >& companyInfoPo,
				std::string& outReserve
				) = 0;
	};
	
	
}
}
}

#endif /*COMPANYAO_INTERFACE_H*/
